import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';

const notFoundRouter = {
    path: '/:catchAll(.*)',
    redirect: '/404',
    hidden: true,
};
const routes: RouteRecordRaw[] = [
    {
        path: '/',
        name: 'home',
        component: () => import('@/views/Home.vue'), // 建议进行路由懒加载，优化访问性能
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('@/views/Login.vue'), // 建议进行路由懒加载，优化访问性能
    },
    {
        name: '404',
        path: '/404',
        meta: {
            title: '访问异常',
            show: false,
            titleVisible: false,
        },
        component: () => import('@/views/404.vue'),
    },
    notFoundRouter,
];
export const router = createRouter({
    history: createWebHashHistory(),
    routes,
});

export default router;
